package com.czx.controller;

import com.czx.factory.HandlerFactory;
import com.czx.handler.AbstractHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private HandlerFactory handlerFactory;

    @GetMapping("test")
    public void test() {
        AbstractHandler handler = handlerFactory.getHandler(null);
        if (!handler.handle()) {
            System.out.println("验证不通过");
            return;
        }
        System.out.println("处理业务");
    }

}
